{% extends 'myhome/index.html'%}

{% block title %}
<title>搜索--{{sname}}</title>
{% endblock %}

{% block css %}
<link href="/static/myhome/css/seastyle.css" rel="stylesheet" type="text/css" />
<link href="/static/myhome/css/hmstyle.css" rel="stylesheet" type="text/css" />
{% endblock %}

{% block search %}
<!--悬浮搜索框-->
<div class="nav white">
    <div class="logo"><img src="/static/myhome/images/logo.png" /></div>
    <div class="logoBig">
        <li><img src="/static/myhome/images/logobig.png" /></li>
    </div>

    <div class="search-bar pr">
        <a name="index_none_header_sysc" href="#"></a>
        <form action="{% url 'myhome_search' %}">
            <input id="searchInput" name="keywords" value="{{request.GET.keywords}}" type="text" placeholder="搜索请输入商品名称" autocomplete="off">
            <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
        </form>
    </div>
</div>
{% endblock %}


{% block con %}
<div class="search">
            <div class="search-list">
            <div class="nav-table">
               <div class="long-title"><span class="all-goods">全部分类</span></div>
               <div class="nav-cont">
                    <ul>
                        <li class="index"><a href="#">首页</a></li>
                        <li class="qc"><a href="#">闪购</a></li>
                        <li class="qc"><a href="#">限时抢</a></li>
                        <li class="qc"><a href="#">团购</a></li>
                        <li class="qc last"><a href="#">大包装</a></li>
                    </ul>
                    <div class="nav-extra">
                        <i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
                        <i class="am-icon-angle-right" style="padding-left: 10px;"></i>
                    </div>
                </div>
              

            </div>
            
                
                    <div class="am-g am-g-fixed">
                        <div class="am-u-sm-12 am-u-md-12">
                        <div class="theme-popover">                                                     
                            <div class="searchAbout">
                                <span class="font-pale">相关搜索：</span>
                             
                                <a title="{{sname}}" href="#">{{sname}}</a>
                            
                            </div>

                            <div class="clear"></div>
                        </div>
                            <div class="search-content">
                                <div class="sort">
                                    <li {%if request.GET.orderby %} 11 {% else %} class="first" {%endif%} >
                                        <a href="{% url 'myhome_search'%}?keywords={{sname}}" title="综合">综合排序</a>
                                    </li>
                                    <li {%if request.GET.orderby == "-buynum"%} class="first" {%endif%} >
                                        <a href="{% url 'myhome_search'%}?keywords={{sname}}&orderby=-buynum" title="销量">销量排序</a>
                                    </li>
                                    <li {%if request.GET.orderby == "price"%} class="first" {%endif%} >
                                        <a href="{% url 'myhome_search'%}?keywords={{sname}}&orderby=price" title="价格">价格优先</a>
                                    </li>
                                </div>
                                <div class="clear"></div>

                                <ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 boxes">
                                    {% if condation != 1 %}
                                        {% for v in slist %}
                                        <li>
                                            <a href="{% url 'myhome_goodsinfo'%}?gid={{v.id}}">
                                                <div class="i-pic limit">
                                                    <img src="{{v.pic_url}}">                                            
                                                    <p class="title fl {{v.name}}">{{v.name}}</p>
                                                    <p class="price fl {{v.price}}">
                                                        <b>¥</b>
                                                        <strong>{{v.price}}</strong>
                                                    </p>
                                                    <p class="number fl {{v.buynum}}">
                                                        销量<span>{{v.buynum}}</span>
                                                    </p>
                                                </div>
                                            </a>
                                        </li>
                                        {% endfor %}
                                    {% else %}
                                        {% for i in slist %}
                                            {% for v in i %}
                                            <li>
                                                <a href="{% url 'myhome_goodsinfo'%}?gid={{v.id}}">
                                                    <div class="i-pic limit">
                                                        <img src="{{v.pic_url}}">                                            
                                                        <p class="title fl {{v.name}}">{{v.name}}</p>
                                                        <p class="price fl {{v.price}}">
                                                            <b>¥</b>
                                                            <strong>{{v.price}}</strong>
                                                        </p>
                                                        <p class="number fl {{v.buynum}}">
                                                            销量<span>{{v.buynum}}</span>
                                                        </p>
                                                    </div>
                                                </a>
                                            </li>
                                            {% endfor %}
                                        {% endfor %}
                                    {%endif%}


                      
                                </ul>
                            </div>
                            <div class="search-side">

                                <div class="side-title">
                                    热卖推荐
                                </div>
      
                             

                            </div>
                            <div class="clear"></div>
                            <!--分页 -->
                        
                            <ul class="am-pagination am-pagination-right">
                                {% load pagetag %}
                                {% showpages slist.paginator.num_pages request %}
                            </ul>               
                        </div>
                    </div>
                  
                </div>

            </div>
            
{% endblock %}


